﻿using Microsoft.EntityFrameworkCore;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq.Expressions;

namespace OA.Model
{
    //[TableName("管理员权限表")]
    public class AdminPermission : BaseInfo
    {
        public int Status { get; set; }

        [Display(Name = "管理员ID")]
         
        public long AdminID { get; set; }

        [Display(Name = "权限编码")]
        [Required(ErrorMessage = "不能为空")]
        [MaxLength(12)]
        public string PermissionCode { get; set; }        

    }

    public class SimpleAdminPermission : SimpleInfo
    {
 
        public long AdminID { get; set; }
         
        public string PermissionCode { get; set; }
         
        public static Expression<Func<AdminPermission, SimpleAdminPermission>> Map = m => new SimpleAdminPermission()
        {
            ID = m.ID,
            AdminID = m.AdminID,
            PermissionCode = m.PermissionCode,
        };

        public static Expression<Func<AdminPermission, SimpleAdminPermission>> Map2 = m => new SimpleAdminPermission()
        {
            PermissionCode = m.PermissionCode
        };

    }
}
